/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Server;
import java.rmi.server.*;
import Interface.*;
import java.rmi.RemoteException;

/**
 *
 * @author bj
 */
public class FactoryImpl implements Factory{

    DeThi deThi = new DeThiImpl();
    BaiThi baiThi = new BaiThiImpl();
    CauHoi cauHoi = new CauHoiImpl();
    public FactoryImpl()
    {
        try
        {
            UnicastRemoteObject.exportObject(deThi,0);
            UnicastRemoteObject.exportObject(baiThi,0);
            UnicastRemoteObject.exportObject(cauHoi,0);
        }
        catch(Exception ex)
        {
            System.out.print(ex.toString());
        }
    }
    public DeThi createDeThi() throws RemoteException {
        return deThi;
    }

    public BaiThi createBaiThi() throws RemoteException {
        return baiThi;
    }

    public CauHoi createCauHoi() throws RemoteException {
        return cauHoi;
    }
    
}
